<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/style.css" />
    <style>
        body {
            background: #f2f2f2
        }

        .white-bg {
            background: #fff;
            width: 100%;
            padding: 0 .6rem
        }

        .btn {
            margin: 1.2rem .6rem 0 .6rem;
            width: calc(100% - 1.2rem)
        }

        .dun {
            position: absolute;
            bottom: .6rem;
            left: 0;
            right: 0
        }

        .left {
            width: 2.6rem;
            margin-right: .6rem;
        }
    </style>
</head>

<body>
    <div id="app">
        <section>
            <div class="height-33 font-12 text-color-9" style="padding-left:0.6rem">
                请选择银行卡类型
            </div>
            <div class="font-14 text-color-3 white-bg">
                <div class="height-50 flex-justify-between info-item">
                    <div class="flex-align-center">
                        <div class="left">
                            银行
                        </div>
                        <div @click='toChooseBank'>{{bankName}}</div>
                    </div>
                    <img class='grey-right' src=" ../../image/common/grey-right.png">
                </div>
                <div class="height-50 flex-justify-between info-item">
                    <div class="flex-align-center">
                        <div class="left">
                            卡类型
                        </div>
                        <div @click='toChooseCardType'>{{bankType}}</div>
                    </div>
                    <img class='grey-right' src=" ../../image/common/grey-right.png">
                </div>
            </div>
            <div style="height:1.2rem"></div>
            <div class="font-14 text-color-3 white-bg">
                <div class="height-50 flex-align-center info-item">
                    <div class="left">
                        手机号
                    </div>
                    <input v-model='phone' placeholder='请输入银行预留手机号'>
                </div>
            </div>
            <div class="height-33 font-12 text-color-9" style="padding-left:0.6rem">
                信息加密处理，仅用于签约验证。
            </div>
            <button class='red-btn btn'>确认并绑卡</button>
        </section>
        <section>
            <div class="flex-center dun">
                <img src="../../image/merchant/dun.png" alt="" style="height:0.75rem;width:0.6rem;margin-right:.15rem">
                <span class="font-12 text-color-9">好获认证提现系统</span>
            </div>
        </section>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript " src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js "></script>
<script type="text/javascript">
    var vm = new Vue({
        el: '#app',
        data(){
          return{
            bankName: '点击选择银行',
            bankType: '点击选择卡的类型',
            phone:''
          }
        },
        methods: {
            toChooseBank: function() {
                api.actionSheet({
                    cancelTitle: '取消',
                    buttons: ['中国建设银行', '中国银行', '中国农业银行', '交通银行']
                }, function(ret, err) {
                    if (ret) {
                        alert(JSON.stringify(ret));
                     var ret = JSON.stringify(ret);
                     let index = ret.buttonIndex;
                        if(index == 1){
                          this.bankType = '储蓄卡'
                        }else{
                          this.bankType = '信用卡'
                        }
                    } else {
                        alert(JSON.stringify(err));
                    }
                });
            },
            toChooseCardType: function() {
                api.actionSheet({
                    cancelTitle: '取消',
                    buttons: ['储蓄卡', '信用卡']
                }, function(ret, err) {
                    if (ret) {
                        alert(JSON.stringify(ret));
                    } else {
                        alert(JSON.stringify(err));
                    }
                });

            }
        }
    });
    apiready = function() {
        api.parseTapmode();
    };
</script>

</html>
